import pygame
import os

class GameCharacter:
    def __init__(self,screen):
        self.screen = screen
        
        # 加载角色图像
        img_path = os.path.join(os.path.dirname(__file__),'images','mario.bmp')
        print('mario.bmp路径:',img_path)
        self.image = pygame.image.load(img_path)

        # 获取外接矩形
        self.rect = self.image.get_rect()
        self.screen_rect = screen.get_rect()
        
        # 将角色放在屏幕中央
        self.rect.centerx = self.screen_rect.centerx
        self.rect.centery = self.screen_rect.centery
##        self.rect.center = self.screen_rect.center


    def blitme(self):
        """ 在指定位置绘制飞船"""
        self.screen.blit(self.image,self.rect)

class GameCharacterSettings:
    def __init__(self):
        self.screen_width = 1200
        self.screen_height = 800
        self.bg_color = (230,230,230)
